AN001- Example of using and calibrating the CAMMING3 device

In this section we want to describe the first steps that will make the user in his first contact with the CAMMING device. Also you will describe some usage examples of the device.

We can divide in the following sections, the proceed of the operation:

Device declaration in the configuration in unit

As was already explained in the description of the CAMMING device, you must program properly the unit application configuration. It is very important to the piece of code that declares the device, here you should indicate the hardware resources to be used to ensure proper operation. It will be the responsibility of the programmer to pick and choose the most appropriate inputs and outputs. For example with the following line of code:

;--------------------------------- 
; Internal devices declaration 
;--------------------------------- 
INTDEVICE 
device_name  CAMMING3  TCamp  CountS  CountMA  CountMB  IntL IAZero  IntLM IAZeroM InG     InGInt  IoutA  Out
Axis         CAMMING3  2      2.CNT01 2.CNT02  1.CNT01  1    2.INP01 2     2.INP02 2.INP03 5       2.AN01 2.OUT01

You define a CAMMING3 device with “Axis” name where the sampling time is 2 ms. The following are declared all hardware resources necessary for the use of the device, the detailed description is listed in the documentation for your device.

An application that has just inside the device Declaration in configuration unit and a qcl unit that it does not run anything (unless forced to WAIT) already allows to perform the first operations using the capabilities of the device. In fact after downloading the application tool and have done turn, will can change the parameters, observe the States or give commands to devices using the appropriate monitor from QView.
This is very convenient in the early stages of planning when you just want to make some runs or being debugged.

Correct device parameterization

Once declared hardware resources properly to use you need to set some parameters as components that are connected to the Qmove product.

Measure and pulse introduction

Consider the case where the transducer is a bi-directional digital encoder. Suppose that the encoder is directly keyed on an engine that should move the slave axis. You will need to set correctly the measure and pulse the parameters of the device so that it can interpret the pulses arriving at QMove, the instrument will then calculate the position of the axis. The measure and pulse introduction establishes a correspondence between a space in a unit of your choice and a certain number of pulses. In the event that the user already knows the space covered in a round encoder then you'll proceed directly to insert the values.
Example: If the encoder emits 1000 pulses/Rev and you know that the axis moves about 5 cm When the encoder performs exactly one lap then you can insert the following values:

AsseX:measure = 50;
AsseX:pulse = 4000

The measure value introduced involves choosing a unit of measure of mm for measuring positions, in the pulse parameter it was introduced a value equal to the number of encoder impulses multiplied by 4. It is remember that the measure/pulse relationship must be a value between 0.00935 and 1 (for compliance with the limits of accuracy of the device and the product QMove). It's important to remember that the values described above are taken as reference: it's not necessary to introduce the parameters with reference to an encoder revolution as we will describe below.

When the user does not know the measurement parameters, will still be able to make the correct calibration by following these steps:

The encoder resolution is now correctly set.

Another important step to take is to set the maxpos and minpos parameters that define respectively the maximum and the minimum position accessible from axis.

:info:Nota:
È necessario effettuare questa procedura due volte in modo da tarare correttamente sia l'asse master che l'asse slave

Choice of the speed unit

The CAMMING device to measure the speed of the slave axis. The unit of measurement of the instantaneous speed of the axis is chosen through unitvel and decpt parameters. You can select the unit of time of speed with the unitvel parameter: if this is equal to 0 then the speed is measured in Um/min, If it is equal to 1 then is measured in Um/s. The decpt parameter instead determines whether multiple rate-measuring the fundamental unit of measure Um. For example, If the fundamental unit of measure is Um=mm, and unitvel=1 you get the speed indicator in the vel variable in:
mm/s (con decpt = 0),
cm/s (con decpt = 1),
dm/s (con decpt = 2),
m/s (con decpt = 3).
Later, if needed, you need to set the proper display on the terminal operator to adjust the correct decimal point position.

Analogue output calibration

:important:Attention:
before the placements you must make sure that wiring and mechanical parts are not cause malfunctions.

We review the case where the CAMMING device uses an analogue output implemented with a DAC to control the slave axis: this will assume 16 bit resolution input discrete values (so between -32768 to 32767) to give analog voltage output range ±10V. This calibration function with analog output can be driven with a constant value in order to test links and functionality.

Preliminary motion

This section describes the steps to verify the correctness of the connections and the functionality of the system which was built.

Analog output adjusting (maxvel parameter setting)

The EANPOS device raises the voltage value of the analogue output on the basis of a proportion between the maximum speed of the axis and the maximum output voltage. To do this you must set the maxvel parameter, that is the speed at which it moves the axle when you are given maximum voltage to the drive. Obviously the axle must behave symmetrical analog voltage to zero, therefore the speed must be the same (in module) to the maximum positive or negative voltage.
In order to know the maximum speed there are two ways: the “theoretical method” you must know the maximum motor speed (Max RPM declared) from which one can easily derive the linear velocity.
If you are not aware of the official maximum speed of the motor it is necessary to proceed in this way:

Now you can then enter the value of the maximum speed in the maxvel parameter.

First moving

:important:Attention:
before moving the axis, verify proper operation of emergency and protection devices.

The procedures described here have allowed us to complete the first phase of parameterizing device. Now you can run smooth movement of the axis. For example, follow these steps:

This first movement was done without turning the ring by reaction of space,so any error introduced by the values of offset voltage or by external agents does not correct.

Esempi di compilazione della cam table

Cam for wire-guide

For example, consider an application for spandifilo, the steps that you must follow the slave axis are:

Sector 1acceleration from zero speed and arrival at preset speed (codeG 131) with positive growth of the slave position;
you need to correctly calculate the relationship between the master and slave output quotas because the speed is correct
Sector 2stretch at constant speed (codeG 133) with positive increase of the slave position
Sector 3deceleration with final speed 0 (codeG 135) with positive increase of the slave position
Sector 4stop slave axis (codeG 133): programming the master fee as you want while you leave anything that slave
Sector 5acceleration from zero speed and arrival at preset speed (codeG 131) with the slave position decrease;
It is necessary to calculate correctly the relationship between master and slave quotas, because the output speed is correct (you can use the same values 1 sector with negative slave quota)
Sector 6stretch at constant speed (codeG 133) with the slave position decrease
Sector 7deceleration with final speed 0 (codeG 135) with the slave position decrease
Sector 8stop slave axis (codeG 133): programming the master quota as you want while you leave anything that slave quota

After running 8 sector can perform functions that execute the re-phasing of master and slave positions in primary impulses by subtracting the space covered until the end of the sector; You can then re-execute the cam automatically.

Camma per taglio al volo con extravelocità

Consideriamo ad esempio un'applicazione per un semplice taglio al volo, i passi che dovrà seguire l'asse slave sono:

Settore 1: accelerazione con partenza da velocità nulla e arrivo alla stessa velocità del master (codeG 132) con incremento positivo della posizione slave. Settore 2: tratto intermedio a velocità costante (codeG 133) con incremento positivo della posizione slave. In questo settore master e slave percorreranno lo stesso spazio. Settore 3: accelerazione e incremento positivo della posizione dell'asse slave. Il settore impostato non è di accelerazione (codeG 133), per fare accelerare lo slave si dovrà impostare uno spazio maggiore rispetto il master. Settore 4: tratto a velocità costante e incremento positivo della posizione slave (codeG 133). Settore 5: decelerazione con incremento positivo della posizione slave (codeG 133). Si riporta lo slave alla stessa velocità del master, perciò la quota dovrà essere calcolata correttamente. Settore 6: decelerazione con velocità finale 0 (codeG 135) con decremento della posizione slave. Settore 7: accelerazione con partenza da velocità nulla e arrivo a velocità preimpostata (codeG 131) con decremento della posizione slave. Settore 8: tratto a velocità costante (codeG 133) con decremento della posizione slave. Settore 9: decelerazione con velocità finale 0 (codeG 135) con decremento della posizione slave.

Dopo l'esecuzione del settore 9 si potranno eseguire delle funzioni che eseguono il ri-fasamento delle posizioni master e slave in impulsi primari sottraendo lo spazio percorso fino a fine settore; in seguito sarà possibile ri-eseguire automaticamente le camma.

Utilizzo di un master simulato

Come è stato spiegato nella descrizione del device CAMMING è possibile che l'asse master sia reale oppure simulata, una via per realizzare un master simulato è dichiarare per il device CAMMING un indirizzo di un trasduttore simulato utilizzando un device di posizionamento (ad esempio EANPOS) dichiarato con il contatore sullo slot 1 (normalmente riservato alla CPU del sistema) e tutte le altre risorse disabilitate.

;--------------------------------- 
; Dichiarazione device interni 
;--------------------------------- 
INTDEVICE 
...
<nome_device>  EANPOS  TCamp  ICont   IntL  IAZero  IOutA
Master               EANPOS  2      1.CNT01 X     X.X     X.X

Il device così configurato viene considerato come un master simulato, esso viene comandato come fosse un normale device tenendo presente che il loop di regolazione deve essere aperto e di conseguenza non serve parametrizzare il PID, è sufficiente impostare il feedforward a 100%.

Esempio di programmazione

Si vuole utilizzare il device EANPOs configurato nell'esempio appena descritto e si ipotizza che il master simulato debba continuare il suo movimento all'infinito.

;------------------------------------------------------------
; Gestione del master simulato
;------------------------------------------------------------
Master:measure = 1000         ;impostazioni parametri master
Master:pulse = 4000
Master:decpt = 0
Master:unitvel = 1
Master:maxvel = 1000
Master:taccdec = 100
Master:maxpos = 999999
Master:minpos = -999999
INIT Master                   ;inizializzazione master simulato
WAIT Master:st_init
LOOPOFF Master
WAIT NOT Master:st_loopon
RESUME Master
WAIT NOT Master:st_emrg
 
MAIN:
IF sf01                       ;flag che da lo start al master
  IF Master: st_still
    Master:posit = 0
    Master:setvel = 500
    Master:setpos = 999999
    START Master              ;comando di START
  ENDIF
  IF Master:posit GE 500000   ;aggiorno la posizione per non causare
                              ;un oveflow
    Master:posit = 0
  ENDIF
ELSE
  IF NOT Master:st_still      ;stop del master simulato
    STOP Master
  ENDIF
ENDIF
 
WAIT 1
JUMP MAIN
END